
import {homeData } from "../../../api/eapi.js";
var WxParse = require('../../../wxParse/wxParse.js');

const pageConfig = {
	data: {
		homeData:'',
		person: [
			{avater: '/images/general_btn_checkbox_sure@2x.png', name: 'Michel Rolland', countryIcon: '/images/general_btn_checkbox_sure@2x.png'},
			{avater: '/images/general_btn_checkbox_sure@2x.png', name: 'Lsabelle Huppert', countryIcon: '/images/general_btn_checkbox_sure@2x.png'}
			],
		multi: true,
    readMore:'e'
	},
	changeMulti() {
		this.setData({multi: !this.data.multi})
	},
  onLoad:function(res){
    let _this=this;
    homeData('chateau/' + res.product, {}).then(es => {
      _this.setData({
        homeData:es.data.data
      });
      let intro= es.data.data.intro,
        feature = es.data.data.feature;
      intro = intro.replace(/\?imageView2\/.*"/, '"')
      feature = feature.replace(/\?imageView2\/.*"/, '"')

      let introData = WxParse.wxParse('intro', 'html', intro, _this, 0),
        featureData = WxParse.wxParse('feature', 'html', feature, _this, 0);

     
      console.log(introData)
      _this.setData(introData);
      _this.setData(featureData);
    })
  },
  readMore(e){
  let _this=this;
  let n=e.currentTarget.dataset.type;
  let a=_this.data.readMore;

    if(a==n){
      _this.setData({
        readMore:'e'
      })
    }else{
      _this.setData({
        readMore:n
      })
    }
  
  }
}

Page(pageConfig)

